import re

regexp = re.compile(f'[A-Z]')


def search_letters(xstr):
    xletters = []
    while True:
        xm = regexp.search(xstr)
        if xm is None:
            break
        xoffset, xoffset2 = xm.regs[0]
        xletter = xstr[xoffset:xoffset2]
        xletters.append(xletter)
        xstr = xstr[xoffset2:]
    return xletters


if '__main__' == __name__:

    xres = search_letters('C和D。普通感冒的药物治疗是感冒药,而普通感冒的临床表现是咽炎和咳嗽。')
    print(xres)

    xres = search_letters('C和D。普通感冒的药物治疗是感冒药,E、F、G而普通JA感冒的临床表现是咽炎和咳嗽。')
    print(xres)
